<%--
 *  File:    ActivityManageHeaderInfo.jsp
 *  @Author: DC
 *  Date:    2011/09/13
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not

 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>



<% //--------------------------------------  setting logger --%>
<%
  
%>
<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "CRM";
    String strTableName = "";
	String privilegeCode = "SFE0150";
    HashMap userinfo = (HashMap)session.getAttribute("userinfo");
%>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/InitEdit.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>ActivityManageHeaderEdit</title>
<%
	String strIsDefault = "";
	if("Y".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=Y";
	}else if ("N".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=N";
	}else  {
		strIsDefault = null;
	}
	
	String activitymanageid = "";
	if (request.getParameter("activitymanageid") != null ){
		activitymanageid = request.getParameter("activitymanageid").toString();
	}
	activitymanageid=(activitymanageid==null)?"":("&activitymanageid="+activitymanageid);
	
	
	String activityconfigid = "";
	if (request.getParameter("activityconfigid") != null ){
		activityconfigid = request.getParameter("activityconfigid").toString();
	}
	activityconfigid=(activityconfigid==null)?"":("&activityconfigid="+activityconfigid);
	
	
	String status = "";
	if (request.getParameter("status") != null ){
		status = request.getParameter("status").toString();
	}
	//status=(status==null)?"":("&status="+status);
	
	
	String isNew = "";
	if("Y".equals(request.getParameter("isNew"))) {
		isNew = "&isNew=Y";
	}else if ("N".equals(request.getParameter("isNew"))) {
		isNew = "&isNew=N";
	}

     String viewflag = "";
     if (request.getParameter("viewflag")!=null&&"view".equals((String)request.getParameter("viewflag"))) {
		viewflag = "&viewflag=view";
	}else{
        viewflag = "&viewflag=";
     }
     
     String activityscope = "";
     if (request.getParameter("activityscope")!=null&&"activityscope".equals((String)request.getParameter("activityscope"))) {
    	 activityscope = "&activityscope=1";
	}else{
		activityscope = "&activityscope=";
     }
     
     
     String optionvalue ="";
     
 	if(pageContext.getAttribute("optionvalue") != null) {
 		optionvalue=((Integer)pageContext.getAttribute("optionvalue")).toString();
 	}
 	optionvalue=(optionvalue==null)?"":("&optionvalue="+optionvalue);
 	
     
 	java.text.DateFormat format=new java.text.SimpleDateFormat("yyyy-MM-dd");
 	//活动影响结束时间
 	Date influencedate=new Date();
 	if(request.getParameter("influencedate")!=null && request.getParameter("influencedate").length()>0 ){
 	  influencedate = format.parse(request.getParameter("influencedate").toString());
 	}

 	//活动准备开始时间

 	Date readystartdate=new Date();
 	if(request.getParameter("readystartdate")!=null  && request.getParameter("readystartdate").length()>0){
 	 readystartdate = format.parse(request.getParameter("readystartdate").toString());
 	}

 	//活动开始时间

 	Date startdate=new Date();
 	if(request.getParameter("startdate")!=null  && request.getParameter("startdate").length()>0){
 	 startdate = format.parse(request.getParameter("startdate").toString());
 	}

 	//活动结束时间
 	Date enddate=new Date();
 	if(request.getParameter("enddate")!=null  && request.getParameter("enddate").length()>0){
 	 enddate = format.parse(request.getParameter("enddate").toString());
 	}

 	//系统时间
	String ss=format.format(new Date());
    Date sysdate = format.parse(ss.toString());
	        

     
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
 <script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript">
function page_detail(action) {
  var alldocuments = window.parent.frames;
  if (isEmpty("<%=activitymanageid%>")){
     alert("<%= message.getMessageDesc("SAVE_INFO_FIRST") %>");
	 return;
  }
  
  var url = "";
  if (action == "ago"){
	  url = "ActivityManageAgoInfo.jsp?<%=OvalTools.randomURL() %>&activityscope=1&detailtype=1<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }
  if (action == "hit"){
	  url = "ActivityManageHit.jsp?<%=OvalTools.randomURL() %>&activityscope=2&detailtype=2<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }
  if (action == "back"){
	  url = "ActivityManageBackInfo.jsp?<%=OvalTools.randomURL() %>&activityscope=3&detailtype=3<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }



  
  if (action == "agoinfo"){
	  url = "ActivityManageAgoInfo.jsp?<%=OvalTools.randomURL() %>&activityscope=1&detailtype=1<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }
  if (action == "hitinfo"){
	  url = "ActivityManageHitInfo.jsp?<%=OvalTools.randomURL() %>&activityscope=2&detailtype=2<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }

  if (action == "backinfo"){
	  url = "ActivityManageBackInfo.jsp?<%=OvalTools.randomURL() %>&activityscope=3&detailtype=3<%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( activityconfigid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%>&isdetail=Y<%=JspHelper.filterNull( viewflag)%>";
	  parent.down.location.href=url;
  }
}


function page_main(action) {
  var url = "";
  if (action == "main"){
	  url = "ActivityManageInfo.jsp?<%= OvalTools.randomURL() %><%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%><%=JspHelper.filterNull( viewflag)%>&startdate=<%=JspHelper.filterNull( startdate)%>&enddate=<%=JspHelper.filterNull( enddate)%>&readystartdate=<%=JspHelper.filterNull( readystartdate)%>&influencedate=<%=JspHelper.filterNull( influencedate)%>"
		//alert(url);
		  parent.down.location.href=url;
  }
  if (action == "cost"){
	  url = "ActivityManageCostDetailInfo.jsp?<%= OvalTools.randomURL() %><%=JspHelper.filterNull( activitymanageid)%><%=JspHelper.filterNull( strIsDefault)%><%=JspHelper.filterNull( isNew)%><%=JspHelper.filterNull( viewflag)%>&startdate=<%=JspHelper.filterNull( startdate)%>&enddate=<%=JspHelper.filterNull( enddate)%>&readystartdate=<%=JspHelper.filterNull( readystartdate)%>&influencedate=<%=JspHelper.filterNull( influencedate)%>"
		//alert(url);
		  parent.down.location.href=url;
  }
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<form name="kform" method="post" action="../../Dispatcher">
			<%@ include file="/inc/PageLocation.inc" %>
    <input type="hidden" name="actionname">

    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <input type="hidden" name="activitymanageid" value="<%=request.getParameter("activitymanageid")%>">
    <input type="hidden" name="startdate" value="<%=request.getParameter("startdate")%>">
    <input type="hidden" name="enddate" value="<%=request.getParameter("enddate")%>">
    <input type="hidden" name="readystartdate" value="<%=request.getParameter("readystartdate")%>">
    <input type="hidden" name="influencedate" value="<%=request.getParameter("influencedate")%>">
	<input type="hidden" name="status" value="<%=request.getParameter("status")%>">
    <input type="hidden" name="subjectcode" value="<%=JspHelper.filterNull( "206" )%>">
    <input type="hidden" name="orgid" value="<%=JspHelper.filterNull( userinfo.get("orgid"))%>">
    

<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td style="PADDING-BOTTOM: 0px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px" class="black_line">
            <table border=0 cellpadding=0 cellspacing=0
            width="100%">

            <tbody>
            <tr>
             <td bgcolor=#FFFFFF class=m_title>&nbsp;</td>
             </tr>
             <tr>
             <td background=../../images/<%= strLanguageCode %>/M_bg.gif  bgcolor=#FFFFFF valign="bottom">
              <table border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td><img src="images/<%= strLanguageCode %>/M_bg.gif" width="1" height="20"></td>
            
            <%
            	if(activitymanageid == ""  && ("").equals(activitymanageid)){
            %>
            <td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
			<td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>
			<%}else{ %>
			
				<%if((("10").equals(status))  || (("20").equals(status))){ %>
				<td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
				<td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>
				<%} else {
					if(readystartdate.after(sysdate))
				{%>
				<td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
				<td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>
				<%}
					else if(enddate.before(sysdate) || sysdate.equals(enddate))
				{%>
				<td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
	            <td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>
	            <td class="hand1" id="A03"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("agoinfo");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Para1ForOCP4")%></div></td>			
	            <td class="hand1" id="A02"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("hitinfo");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Hit")%></div></td>			
	            <td class="hand1" id="A04"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("backinfo");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Back1")%></div></td>
	          	<%}
	           		else if(startdate.before(sysdate)|| startdate.equals(sysdate))
			    {%>
			    <td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
	            <td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>			
	            <td class="hand1" id="A03"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("agoinfo");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Para1ForOCP4")%></div></td>
	            <td class="hand1" id="A02"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("hit");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Hit")%></div></td>
			    <%}
			    	else if((readystartdate.before(sysdate) || readystartdate.equals(sysdate)) )
				{%>
	            <td class="hand1" id="A01" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("main");switchTags(this);'><div align=center><%=label.getLabelName("L_Summary")%></div></td>
	            <td class="hand1" id="A05" valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif"  onclick='javascript:page_main("cost");switchTags(this);'><div align=center><%=label.getLabelName("L_Expense")+label.getLabelName("L_Details1")%></div></td>			
	            <td class="hand1" id="A03"  valign="bottom"  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick='javascript:page_detail("ago");switchTags(this);'><div align=center><%=label.getLabelName("L_Activity")+label.getLabelName("L_Para1ForOCP4")%></div></td>
			    <%}
					} %>
			
			

		    
		    <%} %>


           </tr>
           </table>
          </td>
        </tr>
		
      </table>
    </td>
  </tr>

</table>

  </form>
</body>
</html>


